package cn.bld.service;

import cn.bld.entity.StorageRecord;
import cn.bld.entity.SysUser;
import cn.bld.mapper.SysStorageRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysStorageRecordServiceImpl implements SysStorageRecordService {
    @Autowired
    private SysStorageRecordMapper sysStorageRecordMapper;
    @Override
    public Integer findCount(String goodsName, Integer supplierId ,Integer payStatus) {
        return sysStorageRecordMapper.findCount(goodsName,supplierId,payStatus);
    }

    @Override
    public List<StorageRecord> findByCondition(String goodsName, Integer supplierId,Integer payStatus, Integer pageNo, Integer size) {
        int offset=(pageNo-1)*size;
        return sysStorageRecordMapper.findByCondition(goodsName, supplierId,payStatus, offset, size);
    }

    @Override
    public int insertStorage(StorageRecord storageRecord) {
        return sysStorageRecordMapper.insertStorage(storageRecord);
    }

    @Override
    public StorageRecord findById(Integer id) {
        return sysStorageRecordMapper.findById(id);
    }

    @Override
    public int updateStorage(StorageRecord storageRecord) {
        return sysStorageRecordMapper.updateStorage(storageRecord);
    }

    @Override
    public int deleteStorage(Integer storageRecordId) {
        return sysStorageRecordMapper.deleteStorage(storageRecordId);
    }
}
